ExamPlay Light Logo
Log ind

Computer Science for IGCSE & O level - Programming (Section 16 - No. 13)

What would be the outcome if the `answer` variable is given the value "*" in a case statement where cases are defined for '+', '-', '*' and '/', but no default case is available?
The code block corresponding to the '*' case would be executed.
The code block for the '+' case would be executed.
No code block would be executed.
The program would exit with an error.

Forklaring

The program will search for a match. Because the '*' is a value in the cases, the code block will execute.

Kommentarer (0)

Log ind for at kommentere
Reklame
BrainBehindX Inc Logo
©2026; Drevet af BrainBehindX Inc